"use babel"
import path from "path"

export default function customResolver({
  basedir,
  moduleName
}) {
  const [prefix, ...rest] = moduleName.split("/")

  if (prefix === "this-directory") {
    return "./" + rest.join("/")
  }

  if (prefix === "@") {
    return path.join(__dirname, "src", rest.join("/"))
  }

  if (moduleName[0] === "/") {
    return path.join(__dirname, moduleName)
  }

  if (moduleName === "url-example") {
    return "https://atom.io/packages/js-hyperclick"
  }
}